package com.example.demo.configure;

import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import javax.jms.Queue;

/**
 * @author Jiange
 * @create 2021-05-28-14:04
 */
@Component
@Configuration
@ConfigurationProperties(prefix = "jian")
public class ConfigureBean {
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Bean
    public Queue queue(){
        System.out.println(name);
        return new ActiveMQQueue(name);
    }
}
